<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!-- jQplot CSS -->

<link rel="stylesheet" media="screen" href="css/Tree.css" />
<link rel="stylesheet" media="screen" href="css/docs.css" />
<!-- jQplot CSS END -->

<!-- DATATABLES CSS -->
<link rel="stylesheet" media="screen" href="lib/datatables/css/vpad.css" />
<!-- DATATABLES CSS END -->
<h1 class="page-title">员工培训计划 - 审核</h1>
<div class="container_12 clearfix leading">
	<section class="tabs grid_12 leading">
		<ul class="clearfix" id="tabhost">
			<li><a title="0" href="javascript:void(0)" >新建审核</a></li>
			<li><a title="1" href="javascript:void(0)" >延期审核</a></li>
			<li><a title="2" href="javascript:void(0)" >取消审核</a></li>
		</ul>
		<section id="tabcontent">
			<section title="0" class="clearfix" style="display: block;">
				<header class="grid_12 alpha omega"> </header>
				<div id="demo" class="clearfix">
					<s:if
						test="#request.plan.amendReason == null && #request.plan.cancelReason == null">
						<table class="display" id="example">
							<thead>
								<tr>
									<th>培训课程</th>
									<th>开始日期</th>
									<th>结束日期</th>
									<th>培训对象</th>
									<th>培训类型</th>
									<th>地点</th>
									<th>讲师</th>
									<th>讲师类别</th>
								</tr>
							</thead>
							<tbody>
								<tr class="gradeX">
									<td>${plan.title}</td>
									<td><fmt:formatDate value="${plan.planStartDate}"
											pattern="yyyy-MM-dd HH:mm" /></td>
									<td><fmt:formatDate value="${plan.planEndDate}"
											pattern="yyyy-MM-dd HH:mm" /></td>
									<td><span id="GridView1_ctl04_Label1"> <s:iterator
												var="target" status="st" value="#request.dutyTargets">
												<s:if test="#st.index == #st.count - 1">${target.duty.dutyName}</s:if>
												<s:else>${target.duty.dutyName},</s:else>
											</s:iterator>
									<td>${plan.category}</td>
									<td>${plan.classroom}</td>
									<td>${plan.trainLecturer.employeeinfoWork.baseId.name}</td>
									<td>内聘</td>
								</tr>
							</tbody>
						</table>
					</s:if>
				</div>
			</section>
			<section title="1" class="clearfix" style="display: block;">
				<header class="grid_12 alpha omega"> </header>
				<s:if
					test="#request.plan.amendReason != null && #request.plan.cancelReason == null">
					<div id="demo" class="clearfix">
						<table class="display" id="example">
							<thead>
								<tr>
									<th>培训课程</th>
									<th>原开始日期</th>
									<th>原结束日期</th>
									<th>培训对象</th>
									<th>培训类型</th>
									<th>地点</th>
									<th>讲师</th>
									<th>讲师类别</th>
								</tr>
							</thead>
							<tbody>
								<tr class="gradeX">
									<td>${plan.title}</td>
									<td><fmt:formatDate value="${plan.trainStartDate}" pattern="yyyy-MM-dd HH:mm"/></td>
									<td><fmt:formatDate value="${plan.trainEndDate}" pattern="yyyy-MM-dd HH:mm"/></td>
									<td><span id="GridView1_ctl04_Label1"> <s:iterator
												var="target" status="st" value="#request.dutyTargets">
												<s:if test="#st.index == #st.count - 1">${target.duty.dutyName}</s:if>
												<s:else>${target.duty.dutyName},</s:else>
											</s:iterator>
											<td>${plan.category}</td>
											<td>${plan.classroom}</td>
											<td>${plan.trainLecturer.employeeinfoWork.baseId.name}</td>
											<td>内聘</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div id="demo" class="clearfix">
						<table class="display" id="example">
							<thead>
								<tr>
									<th>更正开始日期</th>
									<th>更正结束日期</th>
									<th>更正理由</th>
								</tr>
							</thead>
							<tbody>
								<tr class="gradeX">
									<td><fmt:formatDate value="${plan.amendStartDate}"
											pattern="yyyy-MM-dd HH:mm" /></td>
									<td><fmt:formatDate value="${plan.amendEndDate}"
											pattern="yyyy-MM-dd HH:mm" /></td>
									<td><span id="GridView1_ctl04_Label1">${plan.amendReason}</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</s:if>
			</section>
			<section title="2" class="clearfix" style="display: block;">
				<header class="grid_12 alpha omega"> </header>
				<s:if test="#request.plan.cancelReason != null">
					<div id="demo" class="clearfix">
						<table class="display" id="example">
							<thead>
								<tr>
									<th>培训课程</th>
									<th>原开始日期</th>
									<th>原结束日期</th>
									<th>培训对象</th>
									<th>培训类型</th>
									<th>地点</th>
									<th>讲师</th>
									<th>讲师类别</th>
								</tr>
							</thead>
							<tbody>
								<tr class="gradeX">
									<td>${plan.title}</td>
									<td><fmt:formatDate value="${plan.trainStartDate}" pattern="yyyy-MM-dd HH:mm"/></td>
									<td><fmt:formatDate value="${plan.trainEndDate}" pattern="yyyy-MM-dd HH:mm"/></td>
									<td><span id="GridView1_ctl04_Label1"> <s:iterator
										var="target" status="st" value="#request.dutyTargets">
										<s:if test="#st.index == #st.count - 1">${target.duty.dutyName}</s:if>
										<s:else>${target.duty.dutyName},</s:else>
									</s:iterator>
									<td>${plan.category}</td>
									<td>${plan.classroom}</td>
									<td>${plan.trainLecturer.employeeinfoWork.baseId.name}</td>
									<td>内聘</td>
								</tr>
							</tbody>
						</table>
					</div>
					<div id="demo" class="clearfix">
						<table class="display" id="example">
							<thead>
								<tr>
									<th>取消理由</th>
								</tr>
							</thead>
							<tbody>
								<tr class="gradeX">
									<td><span id="GridView1_ctl04_Label1">${plan.cancelReason}</span></td>
								</tr>
							</tbody>
						</table>
					</div>
				</s:if>
			</section>
			<section class="clearfix" style="display: none;">
				<header class="grid_12 alpha omega">
					<h2>Tab 4</h2>
				</header>
			</section>
		</section>
	</section>
	<div class="tabs side grid_12 leading">
		<div class="clear"></div>
	</div>
</div>
<%@include file="../common/common_audit.jsp"%>
<script type="text/javascript">
	$(document).ready(function() {
		$("#backlayout").hide();
		setTimeout("timeOutExecute()",300);
	});
	
	function timeOutExecute(){
		<s:if test="#request.plan.amendReason == null && #request.plan.cancelReason == null">setActiveTab(0);</s:if>
		<s:if test="#request.plan.amendReason != null && #request.plan.cancelReason == null">setActiveTab(1);</s:if>
		<s:if test="#request.plan.cancelReason != null">setActiveTab(2);</s:if>
	}

	function setActiveTab(idx){
		$("#tabhost li a").removeClass("current");
		$("#tabhost").find("li").each(function(i) {
			if (i == idx) {
				$(this).find("a").addClass("current");
			}
		});
		$("#tabcontent section").attr("style", "display:none");
		$("#tabcontent").find("section").each(function(i) {
			if (i == idx) {
				$(this).attr("style", "display:block");
			}
		});
	}
	
</script>